package org.sidora.strata.context;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.windows.TopComponent;
import org.sidora.strata.Storage;


/**
 * Action which shows DocsProperties component
 * @author Enric Tartera, Juan Manuel Gimeno, Roger Masgoret
 * @version 1.0
 */
public class DocsPropertiesAction extends AbstractAction {
    
    public DocsPropertiesAction() {
        super(NbBundle.getMessage(DocsPropertiesAction.class, "CTL_DocsPropertiesAction"));
//        putValue(SMALL_ICON, new ImageIcon(Utilities.loadImage(DocsPropertiesTopComponent.ICON_PATH, true)));
    }
    
    public void actionPerformed(ActionEvent evt) {
        TopComponent win = DocsPropertiesTopComponent.findInstance();
        win.open();
        win.requestActive();
    }
    
    public void actionPerformed() {
        DocsPropertiesTopComponent win = DocsPropertiesTopComponent.findInstance();
        win.open();
        win.requestActive();
        win.fillDocsItems(Storage.getContext());
    }
    
    public void cerrar(){
        DocsPropertiesTopComponent win = DocsPropertiesTopComponent.findInstance();
        win.close();
    }
    
    
}
